import java.util.LinkedList;

/**
 * Created with IntelliJ IDEA.
 * Description:双向无头不循环链表
 * User: Admin
 * Date: 2022-05-9
 * Time: 16:11
 */
public class Main {
    public static void main(String[] args) {
        LinkedList linkedList = new LinkedList();
        linkedList.addFirst(15);
        linkedList.remove(2);
        System.out.println(linkedList);
    }
    public static void main3(String[] args) {
        MyLinkedList myLinkedList = new MyLinkedList();
        myLinkedList.addFirst(18);
        myLinkedList.addFirst(15);
        myLinkedList.addFirst(15);
        myLinkedList.addFirst(15);
        myLinkedList.addFirst(20);
        myLinkedList.display();
        myLinkedList.removeAllKey(15);
        myLinkedList.display();
    }
    public static void main2(String[] args) {
        MyLinkedList myLinkedList = new MyLinkedList();
        myLinkedList.addFirst(15);
        myLinkedList.display();
        myLinkedList.remove(15);
        myLinkedList.display();
    }
    public static void main1(String[] args) {
        MyLinkedList myLinkedList = new MyLinkedList();
        myLinkedList.addFirst(15);
        myLinkedList.addFirst(18);
        myLinkedList.addFirst(19);
        myLinkedList.addFirst(22);
        myLinkedList.addFirst(33);
        myLinkedList.display();

        myLinkedList.addLast(18);
        myLinkedList.addLast(21);
        myLinkedList.addLast(22);
        myLinkedList.addLast(25);
        myLinkedList.display();

        myLinkedList.addIndex(0,99);
        myLinkedList.addIndex(10,999);
        myLinkedList.display();
        boolean fly =myLinkedList.contains(18);
        System.out.println(fly);
    }
}
